{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "54ff85dd",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "90ed8461",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "a    1\n",
       "b    2\n",
       "c    3\n",
       "d    4\n",
       "e    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = pd.Series([1,2,3,4,5],index = ['a','b','c','d','e'])\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "6ade1367",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "c    3\n",
       "d    4\n",
       "e    5\n",
       "a    1\n",
       "b    2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.reindex(['c','d','e','a','b'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d1f7330f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "a    1\n",
       "b    2\n",
       "c    3\n",
       "d    4\n",
       "e    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "44bf2281",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "c    3.0\n",
       "d    4.0\n",
       "e    5.0\n",
       "a    1.0\n",
       "b    2.0\n",
       "f    NaN\n",
       "dtype: float64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.reindex(['c','d','e','a','b','f'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b4026bd8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "c    3\n",
       "d    4\n",
       "e    5\n",
       "a    1\n",
       "b    2\n",
       "f    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.reindex(['c','d','e','a','b','f'],method = 'pad')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f46bdba0",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
